@using KeGie.Admin.Server.Language;
@{    
    Layout = null;
    ViewData["Title"] = "没有权限";    
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - 系统</title>
    <link href="~/elementui/index.min.css" rel="stylesheet" />
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
            background-color: #f5f7fa;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }
        .error-container {
            text-align: center;
            padding: 60px 20px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
            max-width: 500px;
            width: 100%;
        }
        .error-code {
            font-size: 120px;
            font-weight: bold;
            color: #409eff;
            margin-bottom: 20px;
        }
        .error-message {
            font-size: 20px;
            color: #606266;
            margin-bottom: 30px;
        }
        .error-desc {
            color: #909399;
            margin-bottom: 40px;
            line-height: 1.6;
        }
        .action-buttons {
            display: flex;
            justify-content: center;
            gap: 16px;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="error-container">
            <div class="error-code">403</div>
            <div class="error-message">@ViewBag.ErrorMessage</div>
            <div class="error-desc">
                抱歉，您没有权限访问此页面。请联系管理员获取访问权限。<br />
                @if (!string.IsNullOrEmpty(ViewBag.CurrentPath))
                {
                    <span>访问路径: @ViewBag.CurrentPath</span>
                }
            </div>
            <div class="action-buttons">
                <el-button type="primary" @@click="goBack" size="large">返回</el-button>
                <el-button @@click="goHome" size="large">返回首页</el-button>
            </div>
        </div>
    </div>

    <script src="~/vue/vue.js"></script>
    <script src="~/elementui/index.min.js"></script>
    <script src="~/elementui/lang/zhCN.js"></script>
    <script src="~/elementui/lang/en.js"></script>
    <script src="~/elementui/lang/fr.js"></script>
    <script src="~/elementui/lang/ja.js"></script>
    <script src="~/elementui/lang/vi.js"></script>
    <script src="~/elementui/lang/zhTW.js"></script>
    <script src="~/vue/vue-i18n.min.js"></script>
    <script src="~/lang/locale/zhCN.js"></script>
    <script src="~/lang/locale/enUS.js"></script>
    <script src="~/lang/locale/frFR.js"></script>
    <script src="~/lang/locale/jaJP.js"></script>
    <script src="~/lang/locale/viVN.js"></script>
    <script src="~/lang/locale/zhTW.js"></script>
    <script src="~/lang/index.min.js"></script>

    <script>
        new Vue({
            el: '#app',
            methods: {
                goBack: function() {
                    // 如果有上一页历史记录，则返回上一页
                    if (document.referrer) {
                        window.history.back();
                    } else {
                        // 否则返回首页
                        this.goHome();
                    }
                },
                goHome: function() {
                    window.location.href = '/';
                }
            }
        });
    </script>
</body>
</html>